<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">


<ui:composition template="/Template.xhtml">

	<ui:define name="menu">
		<table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr height="20">
				<td background="./Images/hg.jpg" width="22" />
				<td background="./Images/h.jpg" width="100" />
				<td background="./Images/menu_hm10.jpg" width="40" />
				<td background="./Images/menu_h.jpg" width="190" />
				<td background="./Images/menu_hd.jpg" width="21" />
				<td width="164" />
				<td background="./Images/menu_hg.jpg" width="22" />
				<td background="./Images/menu_h.jpg" width="105" />
				<td background="./Images/menu_hm00.jpg" width="40" />
				<td background="./Images/menu_h.jpg" width="130" />
				<td background="./Images/menu_hm00.jpg" width="40" />
				<td background="./Images/menu_h.jpg" width="105" />
				<td background="./Images/menu_hd.jpg" width="21" />
			</tr>
			<tr height="35">
				<td background="./Images/g.jpg" width="22" />
				<td bgcolor="#F8F2DA" valign="top" align="center" width="110"><a
					class="menuselect" href="./AnnoncesRecherche.jsf">Les annonces</a></td>
				<td background="./Images/menu_m10.jpg" width="40" />
				<td bgcolor="#C7AFBD" valign="top" align="center" width="140">
					<h:form>
						<h:commandLink class="menu" value="Passer une annonce"
							action="CompteLogin" rendered="#{!compteLogin.connecte}">
							<f:setPropertyActionListener target="#{compteLogin.page}"
								value="1" />
						</h:commandLink>
						<h:panelGroup rendered="#{compteLogin.connecte}">
							<h:commandLink class="menu" value="Passer une annonce"
								action="#{AnnoncesSession.gotoNouvellep}"
								rendered="#{!compteLogin.corp}" />
							<h:commandLink class="menu" value="Passer une annonce"
								action="#{AnnoncesSession.gotoNouvellec}"
								rendered="#{compteLogin.corp}" />
						</h:panelGroup>
					</h:form>
				</td>
				<td background="./Images/menu_d.jpg" width="21" />
				<td />
				<td background="./Images/menu_g.jpg" width="22" />
				<td bgcolor="#C7AFBD" valign="top" align="center" width="100">
					<h:form>
						<h:commandLink class="menu" value="Mes favoris"
							action="CompteLogin" rendered="#{!compteLogin.connecte}">
							<f:setPropertyActionListener target="#{compteLogin.page}"
								value="2" />
						</h:commandLink>
						<h:panelGroup rendered="#{compteLogin.connecte}">
							<h:commandLink class="menu" value="Mes favoris"
								action="AnnoncesProprietaireFavorites"
								rendered="#{!compteLogin.corp}" />
							<h:commandLink class="menu" value="Mes favoris"
								action="AnnoncesChercheurFavorites"
								rendered="#{compteLogin.corp}" />
						</h:panelGroup>
					</h:form>
				</td>
				<td background="./Images/menu_m00.jpg" width="40" />
				<td bgcolor="#C7AFBD" valign="top" align="center" width="100">
					<h:form>
						<h:commandLink class="menu" value="Mes annonces"
							action="CompteLogin" rendered="#{!compteLogin.connecte}">
							<f:setPropertyActionListener target="#{compteLogin.page}"
								value="3" />
						</h:commandLink>
						<h:panelGroup rendered="#{compteLogin.connecte}">
							<h:commandLink class="menu" value="Mes annonces"
								action="AnnoncesProprietairePerso"
								rendered="#{!compteLogin.corp}" />
							<h:commandLink class="menu" value="Mes annonces"
								action="AnnoncesChercheurPerso" rendered="#{compteLogin.corp}" />
						</h:panelGroup>
					</h:form>
				</td>
				<td background="./Images/menu_m00.jpg" width="40" />
				<td bgcolor="#C7AFBD" valign="top" align="center" width="100">
					<h:form>
						<h:commandLink class="menu" value="Mon panier"
							action="CompteLogin" rendered="#{!compteLogin.connecte}">
							<f:setPropertyActionListener target="#{compteLogin.page}"
								value="4" />
						</h:commandLink>
						<h:commandLink class="menu" value="Mon panier" action="Panier"
							rendered="#{compteLogin.connecte}" />
					</h:form>
				</td>
				<td background="./Images/menu_d.jpg" width="21" />
			</tr>
			<tr height="20">
				<td background="./Images/g.jpg" width="22" />
				<td bgcolor="#F8F2DA" />
				<td background="./Images/menu_bm10.jpg" width="40" />
				<td background="./Images/menu_b.jpg" />
				<td background="./Images/menu_mg.jpg" width="21" />
				<td background="./Images/h.jpg" />
				<td background="./Images/menu_md.jpg" width="22" />
				<td background="./Images/menu_b.jpg" />
				<td background="./Images/menu_bm00.jpg" width="40" />
				<td background="./Images/menu_b.jpg" />
				<td background="./Images/menu_bm00.jpg" width="40" />
				<td background="./Images/menu_b.jpg" />
				<td background="./Images/menu_bd.jpg" width="21" />
			</tr>
		</table>
	</ui:define>

	<ui:define name="page">

		<table width="100%" border="0">
			<tr>
				<td width="250" valign="top">
					
					<table border="0" cellpadding="0" cellspacing="0" width="100%">
					
						<tr>
							<td colspan="3">
								<h:form>
								<h:panelGroup rendered="#{Annonces.type eq 1}">
									<table border="0" width="100%" cellspacing="0" cellpadding="0">
										<tr height="90">
											<td width="22" background="./Images/rtg0.jpg"></td>
											<td align="left" background="./Images/rt0.jpg">
												<a class="menu" href="AnnoncesRecherche.jsf?tip=2">Les Offres</a>
											</td>
											<td width="8" background="./Images/rt01.jpg"></td>
											<td align="right" background="./Images/rt1.jpg">
												<a class="menuselect" href="AnnoncesRecherche.jsf?tip=1">Les Demandes</a>
											</td>
											<td width="20" background="./Images/rtd1.jpg"></td>
										</tr>
									</table>
								</h:panelGroup>
								<h:panelGroup rendered="#{Annonces.type eq 2}">
									<table border="0" width="100%" cellspacing="0" cellpadding="0">
										<tr height="90">
											<td width="22" background="./Images/rtg1.jpg"></td>
											<td align="left" background="./Images/rt1.jpg">
												<a class="menuselect" href="AnnoncesRecherche.jsf?tip=2">Les Offres</a>
											</td>
											<td width="4" background="./Images/rt10.jpg"></td>
											<td align="right" background="./Images/rt0.jpg">
												<a class="menu" href="AnnoncesRecherche.jsf?tip=1">Les Demandes</a>
											</td>
											<td width="20" background="./Images/rtd0.jpg"></td>
										</tr>
									</table>
								</h:panelGroup>
								</h:form>
							
							</td>
						</tr>
						
						<tr height="20">
							<td colspan="3"></td>
						</tr>
						<tr height="20">
							<td width="22" background="./Images/menu_rhg.jpg"></td>
							<td background="./Images/menu_rh.jpg"></td>
							<td width="21" background="./Images/menu_rhd.jpg"></td>
						</tr>
						<tr>
							<td width="22" background="./Images/menu_rg.jpg"></td>
							<td align="center" bgcolor="#c7afbd"><h:form>
									<table border="0" width="100%">
										<tr>
											<td align="center" colspan="2"><h3>Recherche par
													Mots Clés</h3></td>
										</tr>
										<tr>
											<td align="right">Mots-Clés</td>
											<td><h:inputText id="motcle" value="#{Annonces.motcle}"
													cols="3" /></td>
										</tr>
										<tr>
											<td align="right" colspan="2"><h:commandButton
													value="Valider" action="#{Annonces.rechercheParMotsCles}" />
											</td>
										</tr>
									</table>
								</h:form></td>
							<td width="21" background="./Images/menu_rd.jpg"></td>
						</tr>
						<tr height="23">
							<td width="22" background="./Images/menu_rbg.jpg"></td>
							<td background="./Images/menu_rb.jpg"></td>
							<td width="21" background="./Images/menu_rbd.jpg"></td>
						</tr>
						<tr height="20">
							<td colspan="0"></td>
						</tr>
						<tr height="20">
							<td width="22" background="./Images/menu_rhg.jpg"></td>
							<td background="./Images/menu_rh.jpg"></td>
							<td width="21" background="./Images/menu_rhd.jpg"></td>
						</tr>
						<tr>
							<td width="22" background="./Images/menu_rg.jpg"></td>
							<td align="center" bgcolor="#c7afbd"><h:form>
									<table border="0" width="100%">
										<tr>
											<td align="center" colspan="3"><h3>Recherche par
													Ville</h3></td>
										</tr>
										<tr>
											<td align="right">Ville</td>
											<td width="15"></td>
											<td><h:selectOneMenu id="ville"
													value="#{Annonces.ville}">
													<f:selectItem id="ville0" itemLabel="Indifférent"
														itemValue="0" />
													<f:selectItem id="paris" itemLabel="Paris"
														itemValue="75000" />
													<f:selectItem id="grenoble" itemLabel="Grenoble"
														itemValue="38000" />
													<f:selectItem id="cayenne" itemLabel="Cayenne"
														itemValue="97300" />
												</h:selectOneMenu></td>
										</tr>
										<tr>
											<td align="right" colspan="3"><h:commandButton
													value="Valider" action="#{Annonces.rechercheParVille}" />
											</td>
										</tr>
									</table>
								</h:form></td>
							<td width="21" background="./Images/menu_rd.jpg"></td>
						</tr>
						<tr height="23">
							<td width="22" background="./Images/menu_rbg.jpg"></td>
							<td background="./Images/menu_rb.jpg"></td>
							<td width="21" background="./Images/menu_rbd.jpg"></td>
						</tr>
					</table>

				</td>
				<td align="center" valign="top"><h:form>
						<h:panelGroup  rendered="#{Annonces.type eq 1}">

							<h1>Les Demandes</h1>
							<p:dataTable value="#{AnnoncesSession.listeannoncesc}"
								var="annoncec" id="Tchercheur" cellspacing="0" dynamic="true"
								paginator="true" paginatorPosition="bottom" rows="10"
								paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
								rowsPerPageTemplate="5,10,15">

								<p:column>
									<f:facet name="header">Photo</f:facet>
									<h:graphicImage value="#{annoncec.annonceentity.photo}"
										width="100" />

								</p:column>
								<p:column>
									<f:facet name="header">Titre</f:facet>				   
				    #{annoncec.annonceentity.titre}				   
				  </p:column>
								<p:column>
									<f:facet name="header">Ville</f:facet>				   
				    #{annoncec.annonceentity.ville}				  
				  </p:column>
								<p:column>
									<f:facet name="header">Date parution</f:facet>				    
				    #{annoncec.annonceentity.date}				    
				  </p:column>
								<p:column>
									<a href="AnnoncesChercheurDetails.jsf?acid=#{annoncec.id}">En
										savoir plus</a>
								</p:column>

							</p:dataTable>


							<br />
							<br />
						</h:panelGroup>
						<h:panelGroup rendered="#{Annonces.type eq 2}">
							<h1>Les Offres</h1>
							<p:dataTable value="#{AnnoncesSession.listeannoncesp}"
								var="annoncep" id="Tproprietaire" cellspacing="0" dynamic="true"
								paginator="true" paginatorPosition="bottom" rows="10"
								paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
								rowsPerPageTemplate="5,10,15">

								<p:column>
									<f:facet name="header">Photo</f:facet>
									<h:graphicImage value="#{annoncep.annonceentity.photo}"
										width="100" />

								</p:column>
								<p:column>
									<f:facet name="header">Titre</f:facet>
				    #{annoncep.annonceentity.titre}
				  </p:column>
								<p:column>
									<f:facet name="header">
										<h:commandLink value="Ville"
											action="#{Annonces.sortByVilleAnnonceProprietaire}"></h:commandLink>
									</f:facet>
				    #{annoncep.annonceentity.ville}
				  </p:column>
				  <p:column>
				    <f:facet name="header">
				    <h:commandLink value="Surface" action="#{Annonces.sortBySurfaceAnnonceProprietaire}">
				    </h:commandLink>
				    </f:facet>
				    #{annoncep.surface}
				  </p:column>
								<p:column>
									<f:facet name="header">
										<h:commandLink value="Loyer"
											action="#{Annonces.sortByLoyerAnnonceProprietaire}"></h:commandLink>

									</f:facet>
				    #{annoncep.loyer}
				  </p:column>

								<p:column>
									<f:facet name="header">
										<h:commandLink value="Date parution"
											action="#{Annonces.sortByDateParutionAnnonceProprietaire}"></h:commandLink>
									</f:facet>				   
				    #{annoncep.annonceentity.date}
				    
				  </p:column>

								<p:column>
									<a href="AnnoncesChercheurDetails.jsf?apid=#{annoncep.id}">En savoir plus</a>
								</p:column>

							</p:dataTable>
						</h:panelGroup>
					</h:form></td>

			</tr>
		</table>





	</ui:define>
</ui:composition>
</html>